const express = require('express')
//创建服务器的实例对象
const app = express()
//导入并配置cors
const cors = require('cors')
app.use(cors())

//配置中间件，解析 appliction/x-www-form-urlencoded
app.use(express.urlencoded({extended:false}))

//导入并使用用户路由
const userRouter = require('./router/user')
app.use('/home',userRouter)


app.listen(3006,()=>{
  console.log('api server running at http://127.0.0.1:3006')
})